<template>
	<view class="searchbar" :style="{backgroundColor: bgColor}" @click="onFocus">
		<view class="input" :style="{borderRadius: radius + 'px'}">
			<uni-icons type="search" size="17"></uni-icons>
			<text>搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: { 
			bgColor: {
				type: String,
				default: '#c00000'
			},
			radius: {
				type: Number,
				default: 18
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			onFocus: function() {
				this.$emit("focus");
			}
		}
	}
</script>

<style lang="scss">
	.searchbar {
		height: 50px;
		padding: 10px;
		box-sizing: border-box;
		overflow: hidden;
	}
	.input {
		display: flex;
		background-color: #fff;
		height: 30px;
		align-items: center;
		justify-content: center;
		font-size: 15px;
		text {
			margin-left: 4px;
		}
	}
	
</style>
